package com.ipad.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.greendao.gen.DaoMaster;
import com.greendao.gen.DaoSession;

/**
 * Created by Administrator on 2018/12/3.
 */

public class DatebaseUtils {
    public static DatebaseUtils datebaseUtils;

    public static DatebaseUtils getInstance() {
        if (datebaseUtils == null) {
            datebaseUtils = new DatebaseUtils();
        }
        return datebaseUtils;
    }

    public DaoSession getSession(Context context) {
        SQLiteDatabase ipid_info = new MyOpenhepler(context, "ipid_info", null).getWritableDatabase();
        return new DaoMaster(ipid_info).newSession();
    }

}
